import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
Vue.config.productionTip = false
import { Tabbar, TabbarItem, Icon, Swipe, SwipeItem, Search, Grid, GridItem, CountDown, Col, Row, List } from 'vant';

import axios from '@/api/http'
// 将 封装后的 axios 放到 vue 的原型对象上
Vue.prototype.$http = axios

Vue.use(Tabbar);
Vue.use(TabbarItem);
Vue.use(Icon);
Vue.use(Search);
Vue.use(Swipe);
Vue.use(SwipeItem);
Vue.use(Grid);
Vue.use(GridItem);
Vue.use(CountDown);
Vue.use(Col);
Vue.use(Row);
Vue.use(List);

// 获取 localstorge 里面的 session 对应的值
var bool = localStorage.getItem('_session');
if (bool === 'true') {
  // 设置 store 里面的 _session
  store.state._session = true;
}

import app_scroll from '@/components/app-scroll/app-scroll.vue'
Vue.component(app_scroll.name, app_scroll)


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
